package util;

import java.util.List;

import model.kml.LatLon;
import model.kml.LineString;

public class KMLUtil {
	
	public static String gerarKMLLineFromList(List<LatLon> list){
		LineString line = new LineString();
		line.setCoordinates(generareCoordinatesFromList(list));
		return line.toString();
	}
	
	private static String generareCoordinatesFromList(List<LatLon> list){
		StringBuffer buffer = new StringBuffer();
		
		for(LatLon latLon : list){
			buffer.append(latLon.getLon());
			buffer.append(",");
			buffer.append(latLon.getLat());
			
			buffer.append(" ");
		}
		return buffer.toString();
	}

	
}
